package Lesson;

import java.util.Scanner;

public class Demo7 {
    public static void main(String[] args) {
        int a = Login("admin","PRD1111");
        if(a == 0){
            ShouYe();
        }
    }

    public static int Login(String username, String passwd){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String uname = sc.nextLine();
        System.out.println("请输入密码：");
        String pswd = sc.nextLine();
        if(uname.equals(username) && pswd.equals(passwd)){
            System.out.println("登录成功！");
            return 0;
        }else{
            System.out.println("登录失败！");
            return -1;
        }
    }

    public static void ShouYe(){
        System.out.println("进入首页！");
    }
}
